tag.
Adding the Cells
:
|
The tag is used to specify the contents of one cell within a row. All of the parameters have the same meanings as were specified previously, except for the fact that they now apply only to the particular cell being defined by the | tag.
Bringing it All Together
Consider the following HTML code:
Row 1, Column 1
|
Row 1, Column 2
|
Row 1, Column 3
|
Row 2, Column 1
|
Row 2, Column 2
|
This is a very general starting point for creating a table. You can see that the definition begins with the tag. Next, the tag specifies that a row follows. Finally, there are three columns created using the tag. Follow the flow of the tags in the above snippet of code. The use of tags and their corresponding end-tags is much like a stack of papers — papers are added and removed from the top of the stack. Always be certain that your tags balance properly. If you successfully typed in the code above, your table should look something like this:
Did it work for you? Wonderful! You've taken your first step to creating beautiful page layouts in HTML. The next step in your journey is to begin adding a little color to the table.
Spice it up with Color!
Let's admit it, color always adds impact to any computer document, whether it be a spreadsheet or an HTML document. The key is to come up with colors that work well together. Take the following table, for instance:
BGCOLOR= #FF0000 #FFFF00 #0000FF
This table illustrates a poor choice of colors. Not only are the colors too bright (well, my retinas are burning a little at the moment, anyway), but they do not compliment each other. Typically, shades of grey are used in graphical displays because they've been found to be pleasing and easy on the eyes (just look at the Mac OS... greyscale coloration is everywhere!) So instead, we could set up the same table with grey:
BGCOLOR= #BBBBBB #DDDDDD #DDDDDD
Thus, we have a coloration scheme which not only is pleasing (and painless) to the eye, but adds a little something extra to the table. More often than not, it's best to stick to using changes in the shade of a single color within a table. For example, if you're Irish and decide to create a page which reflects your heritage, you may want to substitute a nice emerald green for the grey:
BGCOLOR= #009000 #00D000 #00D000
This color scheme is a pleasing mixture of two shades of green:
Row 1, Column 1
|
Row 1, Column 2
|
Row 1, Column 3
|
Looking Ahead
That's it. You now have the basic tools you need to create tables within your HTML documents. Next month we will begin construction of a page which will contain a list of files in tabular form. We will attempt to mimic the look of the Mac OS 8 Finder list view by utilizing our knowledge of color in HTML tables. Don't forget a hardhat!
Code Exercise
Create a table which displays a 16 x 16 pixel image (same size as small icons in the Finder) with a program name, file size, creation date, and type of file to the right of the image. Hint: You need to create a table with four columns — one for the graphic and file name, one for creation date, one for the file size, and one for the file type:
For an extra challenge, add the small triangle which appears to the left of a folder. The code in the next section demonstrates one possibility... don't peek before you try it, though!
Code Exercise Solution
Folder Number One
|
Mon, Feb 16, 1998, 12:00 AM
|
118K
|
-
|
March Column
|
Sat, Feb 14, 1998, 11:00 AM
|
28K
|
DOCMaker File
|
Jeff Frey
jeff@applewizards.net
http://applewizards.net/
| |